#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
#include<stdbool.h>
#define maxsize 35

typedef struct SNode *stack;
struct SNode
{
    double data[maxsize];
    int top;
};

stack creat()
{
    stack s = (stack) malloc(sizeof(struct SNode));
    s->top = -1;
    return s;
}

void push(stack s, double x)
{
    s->data[++s->top] = x;
}

double pop(stack s)
{
    return s->data[s->top--];
}

void calculate(stack s, double k1, double op2, char str)
{
    switch (str) {
        case '+':
            push(s, k1+op2);
            break;
        case '-':
            push(s, k1-op2);
            break;
        case '*':
            push(s, k1*op2);
            break;
        case '/':
            push(s, k1/op2);
            break;
        default:
            break;
    }
}

char a[maxsize];
int main()
{
    gets(a);
    int l = strlen(a);
    stack s = creat();
    int i = l-1;
    for(int i=l-1; i>=0; i--)
    {
        if(a[i]>='0' && a[i]<='9')
        {
            double x = a[i]-'0';
            double m = 10;
            
            for(i -= 1; i>=0; i--)
            {
                if(a[i]>='0' && a[i]<='9')
                {
                    x += m*(a[i]-'0');
                    m *= 10;
                }
                else if(a[i] == '.')
                {
                 x /= m;
                 m = 1;
                }
                else if(a[i] == '-')
                {
                    x = -x;
                }else break;
            }
            push(s, x);
        }
        else if(a[i]=='+' || a[i]=='-' || a[i]=='*' || a[i] =='/')
        {
            double op1 = pop(s);
            double op2 = pop(s);
            if(a[i] == '/' && op2 == 0)
            {
                printf("ERROR");
                return 0;
            }
            calculate(s, op1, op2, a[i]);
        }
    }
    if(s->top == 0) printf("%.1f\n", pop(s));
    else printf("ERROR");
    return 0;
}
//求前缀表达式的值